#ifndef _SPRITE_MANAGER_H
#define _SPRITE_MANAGER_H

#include <vector>
#include <string>
#include <SFML/graphics.hpp>
#include "app.h"

// struct ImageMeta
//  - A struct for storing the metadata of images
struct SpriteMeta
{
	std::string identifier;
};

// class SpriteManager
//   - This class manages sprites for SFML.
//   - Sprites are stored in a static vector.
//	 - The first item of the sprites vector is a placeholder in case of errors
class SpriteManager
{
	
private:
	// std::vector<sf::Sprite*> sprites;
	//  - This vector stores the pointers to sprites
	//      This takes less memory
	std::vector<sf::Sprite*> sprites;
	
	// std::vector<SpriteMeta> sprites_meta;
	//  - This vector stores the metadata of the sprites
	//  - The metadata is stored in the struct SpriteMeta
	std::vector<SpriteMeta> sprites_meta;
	
public:
	// Default constructor
	SpriteManager();
	
	// Destructor
	~SpriteManager();
	
	// function set_sprite()
	//  - Sets sprite using image
	//  - Returns true if succeeds and false if fails
	bool set_sprite(const sf::Image *image, const float position_x, const float position_y, const std::string identifier);
	
	// function get_sprite()
	//  - Recieves identifier as argument
	//  - Returns a pointer to a sprite
	sf::Sprite* get_sprite(const std::string identifier) const;
	
	// function draw_all_sprites()
	//  - Draws all sprites to window
	std::vector<sf::Sprite*> get_all_sprites() const;
};

#endif